import { ApiProperty } from '@nestjs/swagger';
import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from 'typeorm';
import { Room } from './room.entity';

@Entity()
export class Hotel {
  @ApiProperty({ description: '酒店ID', example: 1 })
  @PrimaryGeneratedColumn()
  hotelID: number;

  @ApiProperty({ description: '酒店名称', example: '香格里拉酒店' })
  @Column()
  name: string;

  @ApiProperty({
    description: '酒店地址',
    example: '北京市朝阳区建国门外大街1号',
  })
  @Column()
  address: string;

  @ApiProperty({
    description: '星级评分 (1-5)',
    example: 5,
    minimum: 1,
    maximum: 5,
  })
  @Column()
  starRating: number;

  @ApiProperty({ description: '酒店的所有房间', type: () => [Room] })
  @OneToMany(() => Room, (room) => room.hotel)
  rooms: Room[];
}
